<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/4/18
 * Time: 11:34
 */
namespace app\admin\model;
use think\Model;
use think\Db;

class DriverLoginLogModel extends Model
{
    public function getLoginLog($map,$field='lld.*',$flag = true,$page=1,$limit=10)
    {
        Db::table('xm_login_log_driver lld')
            ->join('driver_base d','d.driver_id=lld.driver_id')
            ->join('driver_info i','d.driver_id = i.driver_id')
            ->where($map)->field($field)->page($page,$limit)->order('log_id desc')->select();
        return  $flag ? Db::table('xm_login_log_driver lld')
            ->join('driver_base d','d.driver_id=lld.driver_id')
            ->join('driver_info i','d.driver_id = i.driver_id')
            ->where($map)->field($field)->page($page,$limit)->order('log_id desc')->select()
           : Db::table('xm_login_log_driver lld')
                ->join('driver_base d','d.driver_id=lld.driver_id')
                ->join('driver_info i','d.driver_id = i.driver_id')
                ->where($map)->field($field)->find();
    }

}